Analysis of the 10x samples. - tSNE plots - Cell cycle regression - PCA - Alignment - Marker gene expression - tSNE colored on metadata

library(Seurat)
## Loading required package: ggplot2
## Loading required package: cowplot
## 
## Attaching package: 'cowplot'
## The following object is masked from 'package:ggplot2':
## 
##     ggsave
## Loading required package: Matrix
library(ggplot2)
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
all10x <- readRDS('/projects/pytrik/sc_adipose/analyze_10x_fluidigm/data/10x')

tSNE Plots

Below are several tSNE plots of the 10x data. tSNE was performed on the first 15 principal components of the log-normalized scaled (nUMI and percent.mito regressed out) data.

Visceral and perirenal seem a bit mixed, and supraclavicular and subcutaneous too.

TSNEPlot(all10x, pt.size=0.1, group.by='sample_name', do.label=T)

tSNE plots of samples within their subtissue. Peri2 and Peri3 seem to overlap really well, as well as Supra1 and Supra2, and Visce1 and Visce3.

subtissues <- all10x@meta.data$sample_name2
t1 <- TSNEPlot(all10x, cells.use=all10x@cell.names[which(subtissues %in% 'Peri')], group.by='sample_name', pt.size=0.2)$plot

t2 <- TSNEPlot(all10x, cells.use=all10x@cell.names[which(subtissues %in% 'Subq')], group.by='sample_name', pt.size=0.2)$plot

t3 <- TSNEPlot(all10x, cells.use=all10x@cell.names[which(subtissues %in% 'Supra')], group.by='sample_name', pt.size=0.2)$plot

t4 <- TSNEPlot(all10x, cells.use=all10x@cell.names[which(subtissues %in% 'Visce')], group.by='sample_name', pt.size=0.2)$plot

#plot_grid(t1, t2, t3, t4)

tSNE colored on subtissue.

TSNEPlot(all10x, group.by='sample_name2', pt.size=0.1)

tSNE colored by cell cycle phase.

TSNEPlot(all10x, group.by='Phase', pt.size=0.1)

Some clustering with different resolutions. res=0.5

TSNEPlot(all10x, pt.size=0.1, group.by='res.0.5', do.label=T)

res=0.6

TSNEPlot(all10x, pt.size=0.1, group.by='res.0.6')

res=0.7

TSNEPlot(all10x, pt.size=0.1, group.by='res.0.7', do.label=T)

res=0.8

TSNEPlot(all10x, pt.size=0.1, group.by='res.0.8', do.label=T)

res=0.9

TSNEPlot(all10x, pt.size=0.1, group.by='res.0.9', do.label=T)

res=1

TSNEPlot(all10x, pt.size=0.1, group.by='res.1', do.label=T)

Cell cycle regression

all10x.ccregout <- readRDS('/projects/pytrik/sc_adipose/analyze_10x_fluidigm/data/10x-ccregout')

tSNE of the cell cycle regressed out. There does not seem to be a lot of structure within samples now.

TSNEPlot(all10x.ccregout, pt.size=0.1, group.by='sample_name')

TSNEPlot(all10x.ccregout, pt.size=0.1, group.by='Phase')

Subtissues

subtissues <- all10x.ccregout@meta.data$sample_name2
t1 <- TSNEPlot(all10x.ccregout, cells.use=all10x.ccregout@cell.names[which(subtissues %in% 'Peri')], group.by='sample_name', pt.size=0.2)$plot

t2 <- TSNEPlot(all10x.ccregout, cells.use=all10x.ccregout@cell.names[which(subtissues %in% 'Subq')], group.by='sample_name', pt.size=0.2)$plot

t3 <- TSNEPlot(all10x.ccregout, cells.use=all10x.ccregout@cell.names[which(subtissues %in% 'Supra')], group.by='sample_name', pt.size=0.2)$plot

t4 <- TSNEPlot(all10x.ccregout, cells.use=all10x.ccregout@cell.names[which(subtissues %in% 'Visce')], group.by='sample_name', pt.size=0.2)$plot

#plot_grid(t1, t2, t3, t4)

PCA

Some PCA plots. PC1 seems to capture cell cycle effects, and PC2 seems to capture some of the sample variability.

PCAPlot(all10x, group.by='Phase', pt.size=0.1)

PCAPlot(all10x, group.by='sample_name', pt.size=0.1)

PCA plot of the cell cycle regressed out data. There is no cell cycle effect anymore.

PCAPlot(all10x.ccregout, group.by='Phase', pt.size=0.1)

PCAPlot(all10x.ccregout, group.by='sample_name', pt.size=0.1)

Alignment

Alignment of the data with and without cell cycle effects regressed out. Both were aligned on 30 subspaces, tSNE was performed on the first 15 CCs.

data.aligned <- readRDS('/projects/pytrik/sc_adipose/analyze_10x_fluidigm/data/10x-aligned')
data.aligned.ccregout <- readRDS('/projects/pytrik/sc_adipose/analyze_10x_fluidigm/data/10x-ccregout-aligned')

tSNE of the aligned data.

TSNEPlot(data.aligned, group.by='sample_name', pt.size=0.1)

tSNE of the aligned data coloured on cell cycle phase.

TSNEPlot(data.aligned, group.by='Phase', pt.size=0.1)

tSNE of the aligned data with cell cycle effects regressed out.

TSNEPlot(data.aligned.ccregout, group.by='sample_name', pt.size=0.1)

tSNE of the aligned data with cell cycle effects regressed out, colored by phase.

TSNEPlot(data.aligned.ccregout, group.by='Phase', pt.size=0.1)

tSNE of the aligned data with cell cycle effects regressed out, colored by subtissue

TSNEPlot(data.aligned.ccregout, group.by='sample_name2', pt.size=0.1)

Marker gene expression

Metadata

FeaturePlot(all10x, c("nGene"), cols.use = c("grey","blue"), no.legend=F)

FeaturePlot(all10x, c("percent.mito"), cols.use = c("grey","blue"), no.legend=F)

FeaturePlot(all10x, c("nUMI"), cols.use = c("grey","blue"), no.legend=F)

Diff

TSNEPlot(all10x, group.by='diff', pt.size=0.1)

ucp1.ctrl

TSNEPlot(all10x, group.by='ucp1.ctrl', pt.size=0.1)

ucp1.ne

TSNEPlot(all10x, group.by='ucp1.ne', pt.size=0.1)

bmi

TSNEPlot(all10x, group.by='bmi', pt.size=0.1)

age

TSNEPlot(all10x, group.by='age', pt.size=0.1)

VlnPlot(all10x, group.by='sample_name', features.plot=c('nGene'), point.size.use = -1, x.lab.rot=T)

VlnPlot(all10x, group.by='sample_name', features.plot=c('nUMI'), point.size.use = -1, x.lab.rot=T)

VlnPlot(all10x, group.by='sample_name', features.plot=c('percent.mito'), point.size.use = -1, x.lab.rot=T)

Cluster 12

Sample composition in cluster 12.

cluster12 <- SubsetData(all10x, cells.use=rownames(all10x@meta.data)[which(all10x@meta.data$res.0.5 %in% 12)])
rotate_x <- function(data, column_to_plot, labels_vec, rot_angle) {
     plt <- barplot(data[[column_to_plot]], col='steelblue', xaxt="n")
     text(plt, par("usr")[3], labels = labels_vec, srt = rot_angle, adj = c(1.1,1.1), xpd = TRUE, cex=0.6)
}
rotate_x((cluster12@meta.data %>% count(sample_name))[,2], 'n', as.vector(unlist((cluster12@meta.data %>% count(sample_name))[,1])), 45)